/*pmFWCFu5nhKkBzYmrkBakU4t2SQqrAeGkgOUpHXZQkAxa7ZQRnHgG9b6jYVNd5AD*/
import ObjTypeUtil from '../../public/utils/ObjTypeUtil'

export default function (props, tempAppcode='', callback) {
    // let searchId = `${this.state.appcode}query`;//appcode+query
    let pageId = `${this.state.appcode}PAGE`;//appcode+PAGE
    let appcode = tempAppcode ? tempAppcode : props.getUrlParam('c')||props.getSearchParam('c');

	return new Promise((resolve,reject)=>{
		props.createUIDom(
			{
				pagecode: pageId,//页面id
				appcode: appcode//小应用id
			},
			function (data) {
				if (data) {
					if (data.template) {
						let meta = data.template;
						props.meta.setMeta(meta);					
					}
				}
				if(ObjTypeUtil.isFunction(callback)){
					callback(data);
				}				
				resolve({'flag':true})
			}
		)
	})

}








/*pmFWCFu5nhKkBzYmrkBakU4t2SQqrAeGkgOUpHXZQkAxa7ZQRnHgG9b6jYVNd5AD*/